package com.xiweicheng.test.proxy.doc.handler;

import java.text.MessageFormat;

import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;

import com.xiweicheng.test.proxy.Utils;

public class InjectDocHandler implements IDocHandler {

	@Override
	public void handle(Document doc, String baseUrl, String basePath) {
		// Document doc = Jsoup.connect("http://en.wikipedia.org/").get();
		Elements head = doc.select("head");

		head.append(MessageFormat.format("<base href=\"{0}/\" />", Utils.getBasePath(basePath)));
//		head.append("<script src=\"https://cdn.bootcss.com/underscore.js/1.8.3/underscore-min.js\"></script>");
	
		doc.select("input#check_code").addClass("input_md5 fl");
	}

}
